const { MongoClient} = require('mongodb');
// Connection URL
const url = 'mongodb://121.36.217.123:10010';
const client = new MongoClient(url);
const dbName = 'Student';
async function main(table) {
  await client.connect();
  console.log('Connected successfully to server');
  const db = client.db(dbName);
  const collection = db.collection(table);
  return collection;
}
module.exports = main